package com.example.demojpa.rockermq;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(nameServer = "192.168.0.108:9876",topic = "myTopic-rock", consumerGroup = "myTopic-rock_consumer_group2", selectorExpression = "vhyu")
public class RocketMQConsumerConfig2 implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        // 处理接收到的消息
        System.out.println("Received message2222: " + message);
    }
}